package org.Vancl.Dao.ImpI;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.Vancl.Dao.xiazhuangtuijianDao;
import org.Vancl.entity.xiazhuangtuijian;
import org.Vancl.utils.BaseDao;


public class xiazhuangtuijianDaoImpI extends BaseDao implements xiazhuangtuijianDao {

	
	public List<xiazhuangtuijian> getid(int id){
		String sql="SELECT * FROM xiazhuangtuijian where xpeid =?";
		ResultSet rs=super.executeQuery(sql,id);
		List<xiazhuangtuijian> list=new ArrayList();
		try {
			while(rs.next()) {
				xiazhuangtuijian xiazhuangtuijian=new xiazhuangtuijian();
				xiazhuangtuijian.setXid(rs.getInt("xid"));
				xiazhuangtuijian.setXpeid(rs.getInt("xpeid"));
				xiazhuangtuijian.setXimages(rs.getString("ximages"));
				xiazhuangtuijian.setXname(rs.getString("xname"));
				xiazhuangtuijian.setXprice(rs.getString("xprice"));
				list.add(xiazhuangtuijian);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally {
			try {
				super.CloseAll(rs, rs.getStatement().getConnection(), rs.getStatement());
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return list;
	}
}
